package com.ym.core.shiro.token;


import com.ym.common.enums.UserUserTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.shiro.authc.UsernamePasswordToken;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@ApiModel("用户表账号登录")
public class UserAccToken extends UsernamePasswordToken implements Serializable {

	@ApiModelProperty("登录账号")
	@NotEmpty
	private String account;

	@ApiModelProperty("登录密码")
	@NotEmpty
	private String pwd;

	@ApiModelProperty("登录用户类型")
	@NotNull
	private UserUserTypeEnum userType;

	@ApiModelProperty("登录设备")
	private String device;

	@Override
	public Object getPrincipal() {
		return this.account;
	}

	@Override
	public Object getCredentials() {
		return this.pwd;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String getDevice() {
		return device;
	}

	public void setDevice(String device) {
		this.device = device;
	}

	public UserUserTypeEnum getUserType() {
		return userType;
	}

	public void setUserType(UserUserTypeEnum userType) {
		this.userType = userType;
	}

}
